import { Component, PropsWithChildren } from 'react'
import { View, Text, Image } from '@tarojs/components'
import { AtList, AtListItem, AtIcon } from "taro-ui"
import mychat from '../../picture/chat.png'
import './index.scss'
import Taro from '@tarojs/taro'

export default class Index extends Component<PropsWithChildren> {
  state: any
  constructor(props) {
    super(props)
    this.state = {
      goodList: [{
        img: 'http://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png',
        tit: '您好,您发布的房子,我想具体咨询一下'
      }, {
        img: 'http://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png',
        tit: '哪个小区的房子?'
      }]
    }
  }
  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }
  onClick() {
    Taro.navigateBack()
  }
  render() {
    return (
      <View className='index'>
        <View className='nav-bar-box'>
          <View className='status-bar'></View>
          <View className='title-bar'>
            <AtIcon onClick={this.onClick.bind(this)} className='icon' value='chevron-left' size='24' color='#fff'></AtIcon>
            <Text className='tit'>一米阳光</Text>
          </View>
        </View>
        <View className='message'>
          <View className='time'>时间{new Date().getHours() + ':' + new Date().getMinutes()}</View>
          <AtList>
            {
              this.state.goodList?.map((item: any, index: number) => {
                return <AtListItem
                  key={index}
                  title={item.tit}
                  thumb={item.img}
                />
              })
            }
          </AtList>
          <View className='keytabble'>
            <Image src={mychat} />
          </View>
        </View>
      </View >
    )
  }
}
